import request from '../utils/request'
type API<T=any> = (...args:T[])=>Promise<any>;

type LoginParams = {
    account: string; 
    password: string
}
export const LoginApi:API<LoginParams>=(body)=>{
   return request('/users/login',{
        method:'post',
        body
    })
}

type AddAccountParams = {
    account:string;
    password:string;
    userGroup:string;
}

export const addAccountApi:API<AddAccountParams>  = (body)=>{
    return request("/users/addOrEditAccount",{
         method:"post",
         body
     })
 }
 
 //获取用户信息
export const getUserInfoApi:API = ()=>{
    return request("/users/getUserInfo")
}
